home *** CD-ROM | disk | FTP | other *** search
/ GameStar 2004 April / Gamestar_61_2004-04_dvdb.iso / DVDStar / Editace / hltp.exe / {app} / Source Code / VirtualDub / vdsvrlnk / vdserver.h < prev    next >
C/C++ Source or Header  |  2003-10-01  |  4KB  |  125 lines

  1. #ifndef f_VDSERVER_H
  2. #define f_VDSERVER_H
  3.  
  4. #include <windows.h>
  5. #include <vfw.h>
  6.  
  7. #ifdef BUILDING_VDSVRLNK_DLL
  8. #define DLLFUNC extern "C" __declspec(dllexport)
  9. #else
  10. #define DLLFUNC extern "C" __declspec(dllimport)
  11. #endif
  12.  
  13. class IVDubAnimConnection {
  14. public:
  15.     virtual BOOL hasAudio() = 0;
  16.     virtual BOOL readStreamInfo(AVISTREAMINFO *lpsi, BOOL fAudio, long *lpFirst, long *lpLast) = 0;
  17.     virtual int readFormat(void *ptr, BOOL fAudio) = 0;
  18.     virtual int readVideo(long lSample, void *lpBuffer) = 0;
  19.     virtual int readAudio(long lSample, long lCount, void *lpBuffer, long cbBuffer, long *lplBytes, long *lplSamples) = 0;    
  20. };
  21.  
  22. class IVDubServerLink {
  23. public:
  24.     virtual void GetComputerName(char *buf) = 0;
  25.     virtual IVDubAnimConnection *FrameServerConnect(char *fs_name) = 0;
  26.     virtual void FrameServerDisconnect(IVDubAnimConnection *) = 0;
  27.     virtual int CreateFrameServer(char *name, HWND hwndServer) = 0;
  28.     virtual void DestroyFrameServer(int handle) = 0;
  29. };
  30.  
  31. DLLFUNC IVDubServerLink * __cdecl GetDubServerInterface();
  32.  
  33.  
  34. enum {
  35.     VDSRVM_BIGGEST            = 0x7f00,
  36.         //    wParam:
  37.         //    lParam:
  38.         //
  39.         //    Return: arena size required to hold largest frame
  40.  
  41.     VDSRVM_OPEN                = 0x7f01,
  42.         //    wParam: length of arena
  43.         //    lParam: 32-bit memory map identifier
  44.         //
  45.         //    Return:    32-bit session ID or NULL on failure
  46.         //
  47.         //    The memory will be mapped in as VDUBFxxxxxxxx
  48.  
  49.     VDSRVM_CLOSE            = 0x7f02,
  50.         //    wParam:
  51.         //    lParam:    32-bit session ID
  52.         //
  53.         //    Return:    0 on success
  54.         //            -4 if session ID is unknown
  55.  
  56.     VDSRVM_REQ_STREAMINFO    = 0x7f03,
  57.         //    wParam: 0 for video stream, 1 for audio stream
  58.         //    lParam: 32-bit session ID
  59.         //
  60.         //    Return: 0 on success, -1 on failure, -2 if stream doesn't exist
  61.         //
  62.         //            arena+0: first sample
  63.         //            arena+4: last sample+1
  64.         //            arena+8: AVISTREAMINFO
  65.  
  66.     VDSRVM_REQ_FORMAT        = 0x7f04,
  67.         //    wParam:    0 for video stream, 1 for audio stream
  68.         //    lParam: 32-bit session ID
  69.         //
  70.         //    Return:    length of format on success
  71.         //            -1 on failure
  72.         //            -2 if stream doesn't exist
  73.         //            -3 if format is too long for shared arena
  74.         //            -4 if session ID is unknown
  75.         //
  76.         //    Format is placed at bottom of shared arena
  77.  
  78.     VDSRVM_REQ_FRAME        = 0x7f05,
  79.         //    wParam:    requested sample #
  80.         //    lParam: 32-bit session ID
  81.         //
  82.         //    Return:    0 on success
  83.         //            -1 on failure
  84.         //            -2 if stream doesn't exist
  85.         //            -3 if frame is too big for shared arena
  86.         //            -4 if session ID is unknown
  87.  
  88.     VDSRVM_REQ_AUDIO        = 0x7f06,
  89.         //    wParam:    requested sample # to start at
  90.         //    lParam: 32-bit session ID
  91.         //    arena+0: number of samples to read
  92.         //
  93.         //    Return: 0 on success
  94.         //                arena+0: number of bytes actually read
  95.         //                arena+4: number of samples actually read
  96.         //                arena+8: data
  97.         //            -1 on failure
  98.         //            -2 if stream doesn't exist
  99.         //            -3 if a sample is too big for shared arena
  100.         //            -4 if session ID is unknown
  101.  
  102.     VDSRVM_REQ_AUDIOINFO    = 0x7f07,    // VirtualDub 1.3b or higher
  103.         //    wParam: requested sample # to start at
  104.         //    lParam: 32-bit session ID
  105.         //    arena+0: number of samples to check
  106.         //
  107.         //    Return: 0 on success
  108.         //                arena+0: number of bytes actually read
  109.         //                arena+4: number of samples actually read
  110.         //            -1 on failure
  111.         //            -2 if stream doesn't exist
  112.         //            -3 if a sample is too big for shared arena
  113.         //            -4 if session ID is unknown
  114. };
  115.  
  116. enum {
  117.     VDSRVERR_OK            = 0,
  118.     VDSRVERR_FAILED        = -1,
  119.     VDSRVERR_NOSTREAM    = -2,
  120.     VDSRVERR_TOOBIG        = -3,
  121.     VDSRVERR_BADSESSION    = -4
  122. };
  123.  
  124. #endif
  125.